/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.google.code.jmarias.server.phases;

import com.google.code.jmarias.common.action.AbstractAction;
import com.google.code.jmarias.common.action.GameAction;
import com.google.code.jmarias.server.Table;
import java.util.*;

/**
 *
 * @author josef
 */
public abstract class AbstractPhase {

    private List<Class> allowedActions = new ArrayList<Class>();

    public List<Class> getAllowedActions() {
        return allowedActions;
    }

    protected Table table;

    /**
     *
     * @param actionA - type class
     * @param actionB - type AbstractAction
     * @return
     */
    public boolean isSameAction(Class actionA, AbstractAction actionB) {
        return actionA.isAssignableFrom(actionB.getClass());
    }

    public abstract AbstractPhase processAction(GameAction action);

    public void setTable(Table table) {
        this.table = table;
    }

}
